<template>
	<view class="">
		<view class=" ">
		<uni-section title="通栏卡片" type="line">
			<uni-card title="店铺评价">
				<view style="width: 130rpx;height: 130rpx; float: left; ">
					<image :src="arr.store[0].storeLogo" style="width: 125rpx;height: 125rpx; float: left;" mode="">
					</image>
				</view>
				<view class="" style="float: left;   width: 360rpx; margin-left: 30px;">
					<text style="float: left; width: 400rpx; margin-top: 30rpx">
						<h4>{{arr.store[0].storeName}}</h4>
					</text>
					<!-- 	<text style="float: left; width: 400rpx;">{{j.creationTime}}</text> -->
					<text style="float: left; width: 400rpx; margin-top: 15rpx">{{arr.store[0].address}}</text>
					
				</view>
				<view class="" style="float:left; width: 460rpx;margin-top: 15rpx ">
					<text style="float:left;"><h4 style="float: left; margin-left: 30px;">评分:</h4><span>
							<u-rate style="" :count="count" v-model="value"></u-rate>
						</span></text>
						<br>
						<text style="float: left;margin-top: 15rpx;margin-left: 3rpx;">
							<h4 style="float: left; margin-top: 20rpx;">详细评价:</h4> <span style="float: left; width: 300rpx;">
							<u--textarea v-model="value2" placeholder="请输入内容" autoHeight ></u--textarea>
							</span >
							
						</text>
				</view>
			</uni-card>
		</uni-section>
		</view>
		<view class="">
			<uni-section title="通栏卡片" type="line">
				<uni-card title="回收员评价">
					<view style="width: 130rpx;height: 130rpx; float: left; ">
						<image :src="arr.user[0].photoimg" style="width: 125rpx;height: 125rpx; float: left;" mode="">
						</image>
					</view>
					<view class="" style="float: left;   width: 360rpx; margin-left: 30px;">
						<text style="float: left; width: 400rpx; margin-top: 30rpx">
							<h4>{{arr.user[0].userName}}师傅</h4>
						</text>
						<!-- 	<text style="float: left; width: 400rpx;">{{j.creationTime}}</text> -->
						<text style="float: left; width: 400rpx; margin-top: 15rpx">{{arr.user[0].phone}}</text>
						
					</view>
					<view class="" style="float:left; width: 460rpx;margin-top: 15rpx ">
						<text style="float:left;"><h4 style="float: left; margin-left: 30px;">评分:</h4><span>
								<u-rate style="" :count="count" v-model="value1"></u-rate>
							</span></text>
							<br>
							<text style="float: left;margin-top: 15rpx;margin-left: 3rpx;">
								<h4 style="float: left; margin-top: 20rpx;">详细评价:</h4> <span style="float: left; width: 300rpx;">
								<u--textarea v-model="value3" placeholder="请输入内容" autoHeight ></u--textarea>
								</span >
								
							</text>
					</view>
				</uni-card>
			</uni-section>
		</view>
		<view class="">
			<uni-section title="通栏卡片" type="line">
				<uni-card title="订单详情">

					<view class="" style="float: left;   width: 460rpx; ">
						<text style="float: left; width: 400rpx;">详细地址：{{arr.recyclingorder.address}}</text>
						<!-- 	<text style="float: left; width: 400rpx;">{{j.creationTime}}</text> -->
						<text style="float: left; width: 400rpx; margin-left: 28rpx;">
							联系人：{{arr.recyclingorder.contactsName}}</text>
						<text style="float: left; width: 400rpx;">联系电话：{{arr.recyclingorder.phone}}</text>
						<text style="float: left; width: 450rpx;">上门时间：{{arr.recyclingorder.getTime}}</text>
						<text style="float: left; width: 400rpx;">回收内容：{{arr.recyclingorder.content}}</text>
						<text style="float: left; width: 400rpx;">预计重量：{{arr.recyclingorder.weight}}KG</text>
						<text style="float: left; width: 400rpx; margin-left: 56rpx;">
							备注：{{arr.recyclingorder.remarks}}</text>
					</view>
				</uni-card>
			</uni-section>
		</view>
        <u-button @click="submit()">提交</u-button>
	</view>
</template>

<script>
	import request from '../../request.js'
	export default {
		data() {
			return {
				count: 5,
				value:0,
				value1:0,
				value2:'',
				value3:'',
				arr2: [],
				roId: '',
				arr: '',
				value1: '',
				evaluate:{
					userId:'',
					riderId:'',
					storeId:'',
					orderId:'',
					storeEvaluate:'',
					storeScore:'',
					riderEvaluate:'',
					riderScore:''
				},
			}
		},
		onLoad(w) {
			this.roId = w.roId
			this.load()
		},
		methods: {
			load() {
				request({
					url: 'xkuser/recyclingorder/find/' + this.roId,
					method: 'get',
					success: (res) => {
						this.arr = res.data.data.data
						console.log(this.arr)
						this.arr.recyclingorder.creationTime.replace('T', '')
					}
				});
			},
			submit(){
				this.evaluate.userId=this.arr.recyclingorder.userId
				this.evaluate.storeId=this.arr.recyclingorder.storeId
				this.evaluate.riderId=this.arr.recyclingorder.riderId
				this.evaluate.orderId=this.arr.recyclingorder.roId
				this.evaluate.storeEvaluate=this.value2
				this.evaluate.storeScore=this.value
				this.evaluate.riderEvaluate=this.value3
				this.evaluate.riderScore=this.value1
				console.log(this.evaluate)
				request({
					url:'xkuser/evaluate/addevaluate',
					method:'POST',
					data:this.evaluate,
					dataType:'json',
					success:(res)=>{
						uni.showToast({
								title:'提交成功'
							});
						uni.reLaunch({
							url:'./user'
						})
					}
				})
			},
		}
	}
</script>

<style>
</style>
